package com.enqualcomm.kids.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.HorizontalScrollView;

public class MyHorizontalScrollView extends HorizontalScrollView {
	public MyHorizontalScrollView(Context context, AttributeSet attrs,
			int defStyle) {
		super(context, attrs, defStyle);
	}

	public MyHorizontalScrollView(Context context) {
		super(context);
	}

	public MyHorizontalScrollView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public void setScrollChangedListener(ScrollViewListener listener){
		this.listener = listener;
	}
	
	@Override
	protected void onScrollChanged(int l, int t, int oldl, int oldt) {
		super.onScrollChanged(l, t, oldl, oldt);
		if (listener!=null) {
			listener.onScrollChanged(this, l, t, oldl, oldt);
		}
	}
	
	private ScrollViewListener listener;
	public static interface ScrollViewListener{
		 void onScrollChanged(MyHorizontalScrollView scrollView, int x, int y, int oldx, int oldy);  
	}

}
